FROM debian:12.12-slim
LABEL author=xiaoyilin
LABEL email=406735078@qq.com
ENV TZ=Asia/Shanghai
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources && \
apt update && apt install -y curl xz-utils && \
curl -fsS https://dlang.org/install.sh | bash -s dmd && \
# 基础镜像中使用sh而不是bash而source对应bash的函数
apt purge -y curl xz-utils && \
apt autoremove -y && apt autoclean && \
rm -rf /var/lib/apt/lists/*

# docker build -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/dmd:2.111.0-debian1212 .
# docker run -it registry.cn-hangzhou.aliyuncs.com/xiaoyilin/dmd:2.111.0-debian1212 bash
# Run `source ~/dlang/dmd-2.111.0/activate` in your shell to use dmd-2.111.0.
# This will setup PATH, LIBRARY_PATH, LD_LIBRARY_PATH, DMD, DC, and PS1.
# Run `deactivate` later on to restore your environment.
# dmd --version